package com.artPreter.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.artPreter.mapper.DepartMapper;
import com.artPreter.pojo.Depart;
import com.artPreter.pojo.DepartTemp;
import com.artPreter.mapper.DepartTempMapper;
import com.artPreter.service.IDepartTempService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 艺术机构模板表 服务实现类
 * </p>
 *
 * @author jarvis
 * @since 2024-11-18
 */
@Service
public class DepartTempServiceImpl extends ServiceImpl<DepartTempMapper, DepartTemp> implements IDepartTempService {


    @Override
    public DepartTemp getDepartTemp(DepartTemp departTemp) {
        LambdaQueryWrapper<DepartTemp> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(DepartTemp::getDepartId,departTemp.getDepartId());
        List<DepartTemp> list = this.baseMapper.selectList(lambdaQueryWrapper);
        if(list.size()>0){
            return list.get(0);
        }else{
            return null;

        }
    }
}
